package org.eclipselabs.egf.portfolio.task.scala.test.character

import org.eclipse.core.runtime.IProgressMonitor
import org.eclipse.egf.core.EGFCorePlugin
import org.eclipse.egf.core.producer.InvocationException
import org.eclipse.egf.ftask.producer.context.ITaskProductionContext
import org.eclipse.egf.ftask.producer.invocation.ITaskProduction
import java.lang.Character

class CharacterSort extends ITaskProduction{
	
	def preExecute(taskProductionContext:ITaskProductionContext , monitor:IProgressMonitor ) ={
	}
	
	def doExecute(taskProductionContext:ITaskProductionContext , monitor:IProgressMonitor )={
		var first = taskProductionContext.getInputValue("firstCharSort", classOf[Character])
		var second = taskProductionContext.getInputValue("secondCharSort", classOf[Character])
		if(first > second){
			taskProductionContext.setOutputValue("firstCharSort",second)
			taskProductionContext.setOutputValue("secondCharSort",first)
		}
	}
	
	def postExecute(taskProductionContext:ITaskProductionContext , monitor:IProgressMonitor )={
	}
}